package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(("/customer/orders/project"))
@Api(tags = "项目管理")
public class CustomerOrdersProjectController extends BaseController {
    @Autowired
   private NursingProjectService nursingProjectService;

    @ApiOperation("分页查询护理项目列表")
    @GetMapping("/page")
    public ResponseResult page(String name,  Integer pageNum, Integer pageSize, Integer status) {
        log.info("name:{},page:{},pageSize:{},status:{}", name, pageNum, pageSize, status);
        PageResponse pageResponse = nursingProjectService.page(name, pageNum, pageSize, status);
        return success(pageResponse);
    }



    /**
     * 根据id查询项目信息
     *
     * @param id
     * @return
     */
    @ApiOperation("根据id查询项目信息")
    @GetMapping("/{id}")
    public ResponseResult<NursingProjectVo> selectById(@PathVariable Long id) {
        NursingProjectVo nursingProjectVo =nursingProjectService.selectById(id);
        return success(nursingProjectVo);
    }



}
